﻿using System.Collections;
using FlowCanvas.Nodes;
using Yoozoo.Gameplay.Liberty.AI;
using Yoozoo.Gameplay.Liberty.PlayerController;

namespace Yoozoo.Gameplay.Liberty.StreetEvent
{
    public class PlayerExitVehicle : LatentActionNode
    {
        public override IEnumerator Invoke()
        {
            LibertyAIUtils.PlayerController.vehicleBehaviourMgr.StartExitCar();

            yield return new UnityEngine.WaitUntil(() =>
            {
                return LibertyAIUtils.PlayerController.vehicleBehaviourMgr.enterExitCarState == EnterExitCarState.None;
            });
        }
        
    }
}